import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/banck/businessReport/salespersonReport',
  importExcel = '/channelReport/channelReport/importExcel',
  exportXls = '/banck/businessReport/salespersonReportExcel',
}

/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;

// mock 加数组 数要随机
const mockData = [
  {
    aloneBrokerAmt: 21,
    area: '地区1',
    balanceAmt: 21,
    brokerAmt: 43,
    brokerageAmt: 54,
    salesman: '渠道1',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 54,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 433,
    brokerageAmt: 564,
    salesman: '渠道1',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 32,
  },
  {
    aloneBrokerAmt: 21,
    area: '地区1',
    balanceAmt: 21,
    brokerAmt: 43,
    brokerageAmt: 54,
    salesman: '渠道1',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 54,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 433,
    brokerageAmt: 564,
    salesman: '渠道1',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 32,
  },
  {
    aloneBrokerAmt: 2521,
    area: '地区2',
    balanceAmt: 2413,
    brokerAmt: 4333,
    brokerageAmt: 564,
    salesman: '渠道1',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 362,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 423,
    brokerageAmt: 564,
    salesman: '渠道2',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 362,
  },
  {
    aloneBrokerAmt: 2451,
    area: '地区2',
    balanceAmt: 2431,
    brokerAmt: 4323,
    brokerageAmt: 5634,
    salesman: '渠道2',
    totalAmt: 32,
    channelBrokerAmt: 23,
    taxAmt: 43,
    systemServiceAmt: 352,
  },
];
/**
 * 列表接口
 * @param params CHECKING
 */
export const list = (params) => {
  // return Promise.resolve(mockData);
  return defHttp.post({ url: Api.list, params });
};
